﻿<?xml version="1.0" encoding="utf-8"?>
<!--
* Obilogic.SPYamIt!
* ==========
*
* Obilogic (http://community.obilogic.co.uk/)
* Copyright © Obilogic Ltd. All Rights Reserved.
*
* RSS(http://community.obilogic.co.uk/blogs/MainFeed.aspx)
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
-->
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
    Location="ScriptLink"
    ScriptBlock="function ecbSPYamIt(siteurl,itemurl){
    if(siteurl.indexOf('/',8) &lt; 0){
    yamit_body = siteurl;
    }else{
    yamit_body = siteurl.substr(0,siteurl.indexOf('/',8));}
    if(itemurl.indexOf('&amp;Source=',8) &lt; 0){
    yamit_body += itemurl;
    }else{
    yamit_body += itemurl.substr(0,itemurl.indexOf('&amp;Source=',8));}
    yamit_body += '\n\n(#SPYamIt)';
    window.open('https://www.yammer.com/home/bookmarklet?t=SPYamIt&amp;u=' + escapeProperly(yamit_body),'SPYamIt','width=650,height=550,toolbar=1,status=1,resizable'); 
    }"
    Sequence="101">
  </CustomAction>
  <CustomAction
    Id="ObilogicSPYamIt_DocumentLibraryItems"
    RegistrationType="List"
    RegistrationId="101"
    Rights="ViewListItems"
    ImageUrl="~sitecollection/Style Library/SPYamItAssets/yamit-ico.png"
    Location="EditControlBlock"
    Sequence="252"
    Title="'Yam It!'" >
    <UrlAction Url="javascript:ecbSPYamIt('{SiteUrl}','{ItemUrl}')"/>
  </CustomAction>
  <CustomAction
      Id="ObilogicSPYamIt_WebPageItems"
      RegistrationType="List"
      RegistrationId="119"
      Rights="ViewListItems"
      ImageUrl="~sitecollection/Style Library/SPYamItAssets/yamit-ico.png"
      Location="EditControlBlock"
      Sequence="252"
      Title="'Yam It!'" >
    <UrlAction Url="javascript:ecbSPYamIt('{SiteUrl}','{ItemUrl}')"/>
  </CustomAction>
</Elements>
